import { createRouter, createWebHistory } from 'vue-router'
import GaoDe from '../components/GaoDe.vue'

const routes = [
  {
    path: '/',
    name: 'map',
    component: GaoDe
  },
  {
    path: '/main',
    name: 'Main',
    component: () => import('@/views/Main'),
    children: [
      {
        path: '/evaluationTarget',
        name: 'evaluationTarget',
        component: () => import('@/views/evaluation/EvaluationTarget.vue'),
        meta: {
          title: '评估对象',
          computeButton: true
        },
      },
      {
        path: '/shortCircuit',
        name: 'shortCircuit',
        component: () => import('@/views/evaluation/ShortCircuit.vue'),
        meta: {
          title: '短路电流计算校核',
          computeButton: true,
          subTitle: '分布式电源配置',
          subText: '配电网拓扑选择'
        },
      },
      {
        path: '/voltageDeviation',
        name: 'voltageDeviation',
        component: () => import('@/views/evaluation/VoltageDeviation.vue'),
        meta: {
          title: '电压偏差计算校核',
          computeButton: true,
          subTitle: '分布式电源配置',
          subText: '配电网拓扑选择'
        },
      },
      {
        path: '/safety',
        name: 'safety',
        component: () => import('@/views/evaluation/Security.vue'),
        meta: {
          title: '安全性',
          resultButton: true
        },
      },
      {
        path: '/economic',
        name: 'economic',
        component: () => import('@/views/evaluation/Economy.vue'),
        meta: {
          title: '经济性',
          resultButton: true
        },
      },
      {
        path: '/powerQuality',
        name: 'powerQuality',
        component: () => import('@/views/evaluation/PowerQuality.vue'),
        meta: {
          title: '供电质量',
          resultButton: true
        },
      },
      {
        path: '/relayProtection',
        name: 'relayProtection',
        component: () => import('@/views/evaluation/RelayProtection.vue'),
        meta: {
          title: '继电保护',
          resultButton: true
        },
      },
      {
        path: '/comprehensiveEvaluation',
        name: 'comprehensiveEvaluation',
        component: () => import('@/views/evaluation/ComprehensiveEvaluation.vue'),
        meta: { title: '综合评估' },
      },
    ],
  }
]

const router = createRouter({
  history: createWebHistory(process.env.BASE_URL),
  routes
})

export default router
